package qianting.news.service.logger.controller;

import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import qianting.news.apis.models.logger.dtos.LoggerSearchDto;
import qianting.news.common.entity.State;
import qianting.news.service.logger.service.LoggerService;

import java.io.IOException;

@RestController
@RequestMapping("/")
public class LoggerController {

    @Autowired
    private LoggerService loggerService;

    //分页查询所有的日志,按照时间排序
    @ApiOperation(value = "logger日志分页检索")
    @PostMapping("/list")
    public State search(@RequestBody LoggerSearchDto dto) throws IOException {

        return loggerService.search(dto);

    }

}
